//
//  ViewController.m
//  网页界面
//
//  Created by 随 on 2017/3/27.
//  Copyright © 2017年 zzg. All rights reserved.
//

#import "ViewController.h"
#import "oneViewController.h"


@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *name;
@property (weak, nonatomic) IBOutlet UITextField *password;

@property (nonatomic , strong) UIAlertView * ale;

@property (nonatomic , strong) UIAlertView * ale2;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (IBAction)press:(id)sender
{
    NSString * ZH = _name.text;
    NSString * MM = _password.text;
    
    if ([ZH isEqualToString:@"root"] && [MM isEqualToString:@"123"])
    {
        _ale2 = [[UIAlertView alloc]initWithTitle:@"登录成功" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
        [_ale2 show];
        
//        oneViewController * one = [[oneViewController alloc]init];
//        
//        [self presentViewController:one animated:YES completion:nil];
        ViewController * vc = [self.storyboard instantiateViewControllerWithIdentifier:@"denglu"];
        [self presentViewController:vc animated:YES completion:nil];
        
    }
    else
    {
        _ale = [[UIAlertView alloc]initWithTitle:@"登录失败" message:@"账号或密码错误" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
        
        [_ale show];
    }
    
}

-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
